#ifndef __PD_UFP_H__
#define __PD_UFP_H__
#include "FUSB302_UFP.h"
#include "PD_UFP_Protocol.h"
typedef enum
{
    E_PD_UFP_OK = 0,
    E_PD_UFP_ERR_INIT = -1,
}PD_UFP_ErrTable;

typedef enum
{
    STATUS_POWER_NA = 0,
    STATUS_POWER_TYP,
    STATUS_POWER_PPS
} status_power_t;
PD_UFP_ErrTable PD_UFPInit(uint16_t PPS_voltage, uint8_t PPS_current, enum PD_power_option_t power_option);

float get_voltage(void);
float get_current(void);
bool is_power_ready(void);
bool is_PPS_ready(void);
bool is_ps_transition(void);
void run(void);
status_power_t get_power_status(void);
uint8_t set_PPS(uint16_t PPS_voltage, uint8_t PPS_current);
void set_power_option(enum PD_power_option_t power_option);
void handle_protocol_event(PD_protocol_event_t events);
void handle_FUSB302_event(FUSB302_event_t events);
uint8_t timer(void);
void set_default_power(void);
void status_power_ready(status_power_t status, uint16_t voltage, uint16_t current);
#endif
